package engine.data
{
	import engine.logic.event.LogicEvent;
	
	import flash.geom.Point;
	
	import newx.BaseObject;
	import newx.com.config.TextIni;

	/**
	 * 全局静态管理类 
	 * @author riki
	 * 
	 */	
	public class ModelLocator extends BaseObject
	{		
		private static 	var 	model	:ModelLocator;		
		
		/**默认状态*/
		static public const None:String		=	"none";
		/**登录成功*/
		static public const Gameing:String	=	"gameing";
		
		/**全局事件载体*/
		public		var eventRoot		:BaseObject;
		
		private 	var _isDebug		:Boolean		=	true;		
		//场景对象
		public	 	var scene			:Scene			=	new	Scene(0);	
		
		/**玩家对象*/
		public		var player			:GamePlayer		=	new GamePlayer();
			
		/**资源加载完成*/
		public		var complete		:Boolean		=	false;
		
		/**游戏状态*/
		public		var gameStatus		:String			=	"none";
		
		public		var mainIni			:TextIni;
		
		public 		var serverIni		:TextIni;
//		
//		public function set complete(val:Boolean):void
//		{
//			_complete	=	val;
//		}
//		
//		public function get complete():Boolean
//		{
//			return _complete;
//		}
		
		/**获取实例*/
		public static function getInstance():ModelLocator
		{
			if ( model == null )
			{
				model = new ModelLocator();
			}
			return model;
		}
		
		public function ModelLocator()
	   	{
	   		if ( model != null )
	   		{
	   			throw new Error( "Only one ModelLocator instance should be instantiated" );
	   		}
			init();
	   	}
		
		/**
		 * 初始化数据模型 
		 * 
		 */		
		private function init():void
		{
		}	
		
		public function clearModel():void
		{
			model = null;
		}
	}
}
